package com.ruoyi.help.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.help.mapper.HelpVehicleMapper;
import com.ruoyi.help.domain.HelpVehicle;
import com.ruoyi.help.service.IHelpVehicleService;

/**
 * 车辆Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-13
 */
@Service
public class HelpVehicleServiceImpl implements IHelpVehicleService 
{
    @Autowired
    private HelpVehicleMapper helpVehicleMapper;

    /**
     * 查询车辆
     * 
     * @param uId 车辆主键
     * @return 车辆
     */
    @Override
    public HelpVehicle selectHelpVehicleByUId(Long uId)
    {
        return helpVehicleMapper.selectHelpVehicleByUId(uId);
    }

    /**
     * 查询车辆列表
     * 
     * @param helpVehicle 车辆
     * @return 车辆
     */
    @Override
    public List<HelpVehicle> selectHelpVehicleList(HelpVehicle helpVehicle)
    {
        return helpVehicleMapper.selectHelpVehicleList(helpVehicle);
    }

    /**
     * 新增车辆
     * 
     * @param helpVehicle 车辆
     * @return 结果
     */
    @Override
    public int insertHelpVehicle(HelpVehicle helpVehicle)
    {
        helpVehicle.setCreateTime(DateUtils.getNowDate());
        return helpVehicleMapper.insertHelpVehicle(helpVehicle);
    }

    /**
     * 修改车辆
     * 
     * @param helpVehicle 车辆
     * @return 结果
     */
    @Override
    public int updateHelpVehicle(HelpVehicle helpVehicle)
    {
        helpVehicle.setUpdateTime(DateUtils.getNowDate());
        return helpVehicleMapper.updateHelpVehicle(helpVehicle);
    }

    /**
     * 批量删除车辆
     * 
     * @param uIds 需要删除的车辆主键
     * @return 结果
     */
    @Override
    public int deleteHelpVehicleByUIds(Long[] uIds)
    {
        return helpVehicleMapper.deleteHelpVehicleByUIds(uIds);
    }

    /**
     * 删除车辆信息
     * 
     * @param uId 车辆主键
     * @return 结果
     */
    @Override
    public int deleteHelpVehicleByUId(Long uId)
    {
        return helpVehicleMapper.deleteHelpVehicleByUId(uId);
    }
}
